window.addEventListener('load', function () {
    var tel = document.querySelector('.tel');
    var message = document.querySelector('.message');
    tel.onblur = function () {
        if (tel.value.length !== 11) {
            message.className = 'message error';
            message.innerHTML = '手机号码格式不正确，请重新输入';
        } else {
            message.className = 'message success';
            message.innerHTML = '手机号码格式正确';
        }
        if (tel.value.length === 0) {
            message.className = 'message';
            message.innerHTML = '请输入6~16位密码';
        }
    }
    var inp = document.querySelector('.inp');
    var message1 = document.querySelector('.message1');
    inp.onblur = function () {
        if (inp.value.length < 6 || inp.value.length > 16) {
            message1.className = 'message1 error';
            message1.innerHTML = '密码格式不正确，请重新输入';
        } else {
            message1.className = 'message1 success';
            message1.innerHTML = '密码格式正确';
        }
        if (inp.value.length === 0) {
            message1.className = 'message1';
            message1.innerHTML = '请输入6~16位密码';
        }
    }
    var inp1 = document.querySelector('.inp1');
    var message2 = document.querySelector('.message2');
    inp1.onblur = function () {
        if (inp1.value !== inp.value) {
            message2.className = 'message2 error';
            message2.innerHTML = '密码不一致，请重新输入';
        } else {
            message2.className = 'message2 success';
            message2.innerHTML = '密码一致';
        }
        if (inp1.value.length === 0) {
            message2.className = 'message2';
            message2.innerHTML = '请输入6~16位密码';
        }
    }
})